﻿<Window
    x:Class="ColorWheel.Win.Slider.Demo.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Color Component Slider"
    xmlns:cwc="clr-namespace:ColorWheel.Controls;assembly=ColorWheel.Controls"
    xmlns:global="clr-namespace:ColorWheel.Core;assembly=ColorWheel.Core"
    Height="717"
    Width="640"
    FontSize="12">
    
    <Window.Resources>
        <ResourceDictionary>
            
            <global:ColorToBrush
                x:Key="ColorToBrush" />

        </ResourceDictionary>
    </Window.Resources>
    

    <Grid
        Background="Gray">

        <Button
            VerticalAlignment="Top"
            HorizontalAlignment="Left"
            Margin="267,12,0,0"
            Height="30"
            Click="Button_Click_1"
            Content="Random Color 1"
            Width="108"></Button>

        <Button
            VerticalAlignment="Top"
            HorizontalAlignment="Left"
            Margin="381,12,0,0"
            Height="30"
            Click="Button_Click"
            Content="Random Color 2"
            Width="110"></Button>
                     
        <Label
            Content="Red"
            Height="28"
            HorizontalAlignment="Left"
            Margin="12,46,0,0"
            Name="label1"
            VerticalAlignment="Top"
            Width="50"
            Foreground="White" />        
        
        <cwc:ColorComponentSlider
            x:Name="slider"
            Minimum="0"
            Maximum="255"
            SliderColor="{Binding CurrentColor.RgbColor, Mode=OneWay}"
            SliderColorComponent="R"
            Value="{Binding CurrentColor.R, Mode=TwoWay}"
            Margin="100,48,127,499" />

        <Label
            Content="Green"
            Height="28"
            HorizontalAlignment="Left"
            Margin="12, 84, 0, 0"
            Name="label10"
            VerticalAlignment="Top"
            Width="50"
            Foreground="White" />        
        
        <cwc:ColorComponentSlider
            Margin="100,84,127,463"
            Name="slider1"
            Minimum="0"
            Maximum="255"
            SliderColor="{Binding CurrentColor.RgbColor, Mode=OneWay}"
            SliderColorComponent="G"
            Value="{Binding CurrentColor.G, Mode=TwoWay}" />

        <Label
            Content="Blue"
            Height="28"
            HorizontalAlignment="Left"
            Margin="12, 120, 0, 0"
            Name="label2"
            VerticalAlignment="Top"
            Width="50"
            Foreground="White" />

        <cwc:ColorComponentSlider
            Margin="100,120,127,427"
            Name="slider2"
            Minimum="0"
            Maximum="255"
            SliderColor="{Binding CurrentColor.RgbColor, Mode=OneWay}"
            SliderColorComponent="B"
            Value="{Binding CurrentColor.B, Mode=TwoWay}" />
        
        <Rectangle
            Height="276"
            HorizontalAlignment="Left"
            Fill="{Binding CurrentColor.RgbColor, Converter={StaticResource ColorToBrush}, Mode=OneWay}"
            Margin="14, 295, 0, 0"
            Name="rectangle1"
            Stroke="White"
            VerticalAlignment="Top"
            Width="477" />
        
        <Label
            Content="Saturation"
            Foreground="White"
            Height="28"
            HorizontalAlignment="Left"
            Margin="12, 154, 0, 0"
            Name="label4"
            VerticalAlignment="Top"
            Width="82" />
        
        <cwc:ColorComponentSlider
            Margin="100,156,127,391"
            Maximum="255"
            Minimum="0"
            Name="slider3"
            SliderColor="{Binding CurrentColor.RgbColor, Mode=OneWay}"
            SliderColorComponent="Sat"
            Value="{Binding CurrentColor.Saturation255, Mode=TwoWay}" />
        
        <Label
            Content="Brightness"
            Foreground="White"
            Height="28"
            HorizontalAlignment="Left"
            Margin="12, 190, 0, 0"
            Name="label5"
            VerticalAlignment="Top"
            Width="82" />
        
        <cwc:ColorComponentSlider
            Margin="100,192,127,355"
            Maximum="255"
            Minimum="0"
            Name="slider4"
            SliderColor="{Binding CurrentColor.RgbColor, Mode=OneWay}"
            SliderColorComponent="Bri"
            Value="{Binding CurrentColor.Brightness255, Mode=TwoWay}" />
        
        <Label
            Content="Hue"
            Foreground="White"
            Height="28"
            HorizontalAlignment="Left"
            Margin="12, 226, 0, 0"
            Name="label6"
            VerticalAlignment="Top"
            Width="82" />
        
        <cwc:ColorComponentSlider
            Margin="100,228,127,319"
            Maximum="359.99"
            Minimum="0"
            Name="slider6"
            SliderColor="{Binding CurrentColor.RgbColor, Mode=OneWay}"
            SliderColorComponent="Hue"
            ColorWheel="{Binding Palette, Mode=OneWay}"
            Value="{Binding CurrentColor.Hue360, Mode=TwoWay}" />
        
        <Label
            Content="Transparancy"
            Foreground="White"
            Height="28"
            HorizontalAlignment="Left"
            Margin="12,261,0,0"
            Name="label7"
            VerticalAlignment="Top"
            Width="91" />
        
        <cwc:ColorComponentSlider
            ColorWheel="{Binding Palette, Mode=OneWay}"
            Margin="100,263,127,284"
            Maximum="255"
            Minimum="0"
            Name="slider7"
            SliderColor="{Binding CurrentColor.RgbColor, Mode=OneWay}"
            SliderColorComponent="Alpha"
            Value="{Binding CurrentColor.Alpha255, Mode=TwoWay}" />
        
    </Grid>
</Window>
